import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import './index.scss'

interface IProps {
  checked?: boolean
  className?: string
}

export default class Index extends Component<IProps, {}> {
  props: any

  static options = {
    addGlobalClass: true
  }

  render() {
    const { checked, className='', onClick } = this.props
    return (<View className={`fy-checkbox ${className}`} onClick={onClick && onClick}>
      {
        checked ? (
          <View className='fy-checkbox__unchecked-icon bnn-icon  fy-checkbox__check-icon'>&#xe645;</View>
        ) : (
          <View className='fy-checkbox__unchecked-icon' />
        )
      }
    </View>)
  }
}
